<template>
  <Window
    :title="config.title"
    :color="config.windowColor">
    <component :is="config.itemType" :config="config"/>
  </Window>
</template>

<script>
// component
import Window from './Window'
// items
import ItemSimple from './ItemSimple'
import ItemLabel from './ItemLabel'
import ItemFolder from './ItemFolder'
// config
import getConfig from '../utils/config'

export default {
  name: 'item',
  components: {
    Window,
    ItemSimple,
    ItemLabel,
    ItemFolder
  },
  props: {
    data: Object,
    types: Array
  },
  computed: {
    config () {
      return getConfig(this.data, this.types)
    }
  }
}
</script>

<style lang="scss" scoped>
  
</style>
